<template>
  <dv-charts :option="option"/>
</template>
<script>
import { getLostCount } from '@/api/dataECharts'

export default {
  data() {
    return {
      list: [],
      option: {
        xAxis: {
          name: '月份',
          data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
          axisLabel: {
            style:{
              fill:"#fff"
            }
          }
        },
        yAxis: {
          name: '数量',
          data:"value",
          axisLabel: {
            style:{
              fill:"#fff"
            }
          }
        },
        series: [
          {
            data: [1],
            type: 'line',
          }
        ]
      }
    }
  },
  methods: {
    async getList() {
      this.list = await getLostCount({ year: '2024' })
      this.option.series[0].data = [...Object.values(this.list.rows)]
      this.option = { ...this.option }
    }
  },
  mounted() {
    this.getList()
  }
}

</script>

<style scoped lang="scss">
.dv-capsule-chart {
  display: flex;
  flex-direction: row-reverse;
  width: 80%;
}
</style>
